#include "PictureDateExtracter.h"

#include <QFileInfo>
#include <QDateTime>

static const char* format = "'`'yy MM dd";

QString PictureDateExtracter::getBirthTimeStringOfFile(const QString &filename)
{
    QFileInfo fileinfo(filename);
    if (!fileinfo.exists()) {
        return QString("1234");
    }

    return fileinfo.birthTime().date().toString(format);
}

QString PictureDateExtracter::getLastModifyTimeStringOfFile(const QString &filename)
{
    QFileInfo fileinfo(filename);
    if (!fileinfo.exists()) {
        return QString("5678");
    }

    return fileinfo.lastModified().date().toString(format);
}
